package cn.wolfcode.trip.api.controller;

import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.query.StrategyCommentQueryObject;
import cn.wolfcode.trip.base.service.IStrategyCommentService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * 推荐游记资源控制器
 */
@RestController
@RequestMapping("strategyComments")
public class StrategyCommentController {
    @Autowired
    private IStrategyCommentService strategyCommentService;



    @GetMapping("{strategyId}")
    public PageInfo selectContentById(StrategyCommentQueryObject qo){
        return strategyCommentService.query(qo);
    }

    /**
     * 根据id查询攻略评论
     * 1.资源   /strategyComments
     * 2.请求方式   GET
     * 3.请求参数   id 攻略点评对象的id
     * 4.返回结果   StrategyComment对象
     */
    @GetMapping
    public StrategyComment selectById(Long id){
        return strategyCommentService.selectById(id);
    }
}
